#ifndef __HAL_H__
#define __HAL_H__

#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>

namespace ECG
{
namespace HAL
{

class Device;
typedef boost::shared_ptr<Device> DevicePtr;

class DevManager;
typedef boost::shared_ptr<DevManager> DevManagerPtr;

class Driver;
typedef boost::shared_ptr<Driver> DriverPtr;

class DriverManager;
typedef boost::shared_ptr<DriverManager> DriverManagerPtr;

class FuncFactory;
typedef boost::shared_ptr<FuncFactory> FuncFactoryPtr;

class FuncInterface;
typedef boost::shared_ptr<FuncInterface> FuncInterfacePtr;

#define registerFunc(clazz)                                    \
    extern "C" {                                               \
    boost::shared_ptr<FuncInterface> createClass()             \
    {                                                          \
        return boost::make_shared<clazz>();                    \
    }                                                          \
    void destroyClass(boost::shared_ptr<FuncInterface> clsPtr) \
    {                                                          \
        clsPtr.reset();                                        \
    }                                                          \
    }

#define registerDriver(clazz)                           \
    extern "C" {                                        \
    boost::shared_ptr<Driver> createClass()             \
    {                                                   \
        return boost::make_shared<clazz>();             \
    }                                                   \
    void destroyClass(boost::shared_ptr<Driver> clsPtr) \
    {                                                   \
        clsPtr.reset();                                 \
    }                                                   \
    }
}
}

#endif //__HAL_H__